home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qconnection.h.z / qconnection.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  1.7 KB  |  61 lines

  1. /****************************************************************************
  2. ** $Id: qconnection.h,v 2.6 1998/07/03 00:09:31 hanord Exp $
  3. **
  4. ** Definition of QConnection class
  5. **
  6. ** Created : 930417
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QCONNECTION_H
  25. #define QCONNECTION_H
  26.  
  27. #ifndef QT_H
  28. #include "qobject.h"
  29. #endif // QT_H
  30.  
  31.  
  32. typedef void (QObject::*QMember)();        // pointer to member function
  33.  
  34.  
  35. class QConnection                // signal coupling
  36. {
  37. public:
  38.     QConnection( const QObject *, QMember, const char *memberName );
  39.    ~QConnection() {}
  40.  
  41.     bool     isConnected() const { return obj != 0; }
  42.  
  43.     QObject *object() const  { return obj; }    // get object/member pointer
  44.     QMember *member() const  { return (QMember*)&mbr; }
  45.     const char *memberName() const { return mbr_name; }
  46.     int         numArgs() const { return nargs; }
  47.  
  48. private:
  49.     QObject *obj;                // object connected to
  50.     QMember  mbr;                // member connected to
  51.     const char *mbr_name;
  52.     int         nargs;
  53.  
  54. private:    // Disabled copy constructor and operator=
  55.     QConnection( const QConnection & );
  56.     QConnection &operator=( const QConnection & );
  57. };
  58.  
  59.  
  60. #endif // QCONNECTION_H
  61.